refactor: replaces picocolors with node:util's styleText#346
refactor: replaces picocolors with node:util's styleText#346
picocolors with node:util's styleText#346Conversation
🦋 Changeset detectedLatest commit: 1569bc4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
picocolors with node:util's styleText
picocolors with node:util's styleTextpicocolors with node:util's styleText
|
@example/basic • @example/changesets commit: |
| const prefix = isItem ? (selectableGroups ? `${isLast ? S_BAR_END : S_BAR} ` : ' ') : ''; | ||
| const spacingPrefix = | ||
| groupSpacing > 0 && !isItem ? `\n${color.cyan(S_BAR)} `.repeat(groupSpacing) : ''; | ||
| // groupSpacing > 0 && !isItem ? `\n${color.cyan(S_BAR)} `.repeat(groupSpacing) : ''; |
There was a problem hiding this comment.
is this left over? and should be removed
| .join('\n'); | ||
| output.write( | ||
| `${color.gray(S_BAR)}\n${color.green(S_STEP_SUBMIT)} ${color.reset(title)} ${color.gray( | ||
| `${styleText('gray', S_BAR)}\n${styleText('green', S_STEP_SUBMIT)} ${styleText('reset', title || '')} ${styleText( |
There was a problem hiding this comment.
when is title nullish? i.e. why did we end up with ||?
| output: opts.output, | ||
| render() { | ||
| const title = `${color.gray(S_BAR)}\n${symbol(this.state)} ${opts.message}\n`; | ||
| // const title = `${color.gray(S_BAR)}\n${symbol(this.state)} ${opts.message}\n`; |
There was a problem hiding this comment.
maybe remove this comment too?
| _message = removeTrailingDots(msg); | ||
| _origin = performance.now(); | ||
| output.write(`${color.gray(S_BAR)}\n`); | ||
| // output.write(`${color.gray(S_BAR)}\n`); |
There was a problem hiding this comment.
another comment we can probably remove
| [36m│[39m [2m○[22m [2mGrape[22m | ||
| [36m│[39m [2m○[22m [2mOrange[22m | ||
| [36m│[39m [2m[2m↑/↓[22m[2m to select • [2mEnter:[22m[2m confirm • [2mType:[22m[2m to search[22m | ||
| [36m│[39m [2m[2m↑/↓[22m to select • [2mEnter:[22m confirm • [2mType:[22m to search[22m |
There was a problem hiding this comment.
this shows that styleText doesn't handle nested colours. e.g.:
styleText(`i am dim ${styleText('bold', 'i am bold')} i am no longer dim`);we should search our code for any nested styles and double check they actually work
|
no worries for sure lets hold off until nesting lands 👍 |
| console.clear(); | ||
|
|
||
| p.intro(`${color.bgCyan(color.black(' Integrated Autocomplete Multiselect Example '))}`); | ||
| p.intro(`${styleText('bgCyan', styleText('black', ' Integrated Autocomplete Multiselect Example '))}`); |
There was a problem hiding this comment.
fyi styleText supports an array for cases like this
| p.intro(`${styleText('bgCyan', styleText('black', ' Integrated Autocomplete Multiselect Example '))}`); | |
| p.intro(styleText(['bgCyan', 'black'], ' Integrated Autocomplete Multiselect Example ')); |
|
Closing this in favor of #403. |
Closes: #338